package com.ccmusic.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.google.gson.Gson;

/**
 * 
 * @author Phantom Assassin
 * @date 2019年3月26日 下午12:14:33
 */
public class User {
	private int uid;
	private String uname;
	private String pwd;
	private String usex;
	private String tel;
	private String birthday;
	private String uprofile;
	private String introduce;
	private String ulevel;
	private int ustatus;
	private String regdate;
	
	public User(String uname, String pwd, String usex, String tel, String birthday, String ulevel, int ustatus) {
		super();
		this.uname = uname;
		this.pwd = pwd;
		this.usex = usex;
		this.tel = tel;
		this.birthday = birthday;
		this.ulevel = ulevel;
		this.ustatus = ustatus;
		this.regdate = sdf.format(new Date());
	}

	//静态字段不必set和get，需要set和get就去掉静态。
	private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm");

	@Override
	public String toString() {
		return "User [uid=" + uid + ", uname=" + uname + ", pwd=" + pwd + ", usex=" + usex + ", tel=" + tel
				+ ", birthday=" + birthday + ", uprofile=" + uprofile + ", introduce=" + introduce + ", ulevel="
				+ ulevel + ", ustatus=" + ustatus + ", regdate=" + regdate + "]";
	}
	
	
	
	/**
	 * 用于管理员添加用户信息
	 * @param uname
	 * @param ulevel
	 * @param ustatus
	 * @param regdate
	 */
	public User(int uid, String uname, String usex,  String birthday, 
			String introduce) {
		super();
		this.uid = uid;
		this.uname = uname;
	
		this.usex = usex;
	
		this.birthday = birthday;
	
		this.introduce = introduce;
	
	}
	/**
	 * 用于用户修改用户信息
	 * @param uname
	 * @param ulevel
	 * @param ustatus
	 * @param regdate
	 */
//	public User(String uname,String usex, String ulevel, int ustatus) {
//		super();
//		this.uname = uname;
//		this.pwd = pwd;
//		this.ulevel = ulevel;
//		this.ustatus = ustatus;
//		this.regdate = sdf.format(new Date());
//	}


	/**
	 * 无参构造
	 */
	public User() {
		super();
	}
	
	/**
	 * 用于管理员修改用户信息
	 * @param uid
	 * @param uname
	 * @param ulevel
	 * @param ustatus
	 * @param regdate
	 */
	public User(int uid, String uname, String ulevel, int ustatus, String regdate) {
		super();
		this.uid = uid;
		this.uname = uname;
		this.ulevel = ulevel;
		this.ustatus = ustatus;
		this.regdate = regdate;
	}

	/**
	 * 用于修改用户信息的构造
	 * @param uid
	 * @param uname
	 * @param pwd
	 * @param usex
	 * @param tel
	 * @param birthday
	 * @param uprofile
	 * @param introduce
	 * @param ulevel
	 * @param ustatus
	 * @param regdate
	 */
	public User(int uid, String uname, String pwd, String usex, String tel, String birthday, String uprofile,
			String introduce, String ulevel, int ustatus, String regdate) {
		super();
		this.uid = uid;
		this.uname = uname;
		this.pwd = pwd;
		this.usex = usex;
		this.tel = tel;
		this.birthday = birthday;
		this.uprofile = uprofile;
		this.introduce = introduce;
		this.ulevel = "1";
		this.ustatus = 1;
		this.regdate = sdf.format(new Date());
	}
	
	

	/**
	 * 带参构造，一般不用。
	 * 
	 * @param uname
	 * @param pwd
	 * @param usex
	 * @param tel
	 * @param birthday
	 * @param uprofile
	 * @param ulevel
	 * @param ustatus
	 */
	public User(String uname, String pwd, String usex, String tel, String birthday, String uprofile, String ulevel,
			int ustatus) {
		super();
		this.uname = uname;
		this.pwd = pwd;
		this.usex = usex;
		this.tel = tel;
		this.birthday = birthday;
		this.uprofile = uprofile;
		this.ulevel = ulevel;
		this.ustatus = ustatus;
		this.regdate = sdf.format(new Date());
	}

	/**
	 * 用户必填+选填字段构造方法
	 * 
	 * @param uname
	 * @param pwd
	 * @param usex
	 * @param tel
	 * @param birthday
	 * @param uprofile
	 * @param introduce
	 */
	public User(String uname, String pwd, String usex, String tel, String birthday, String uprofile, String introduce) {
		super();
		this.uname = uname;
		this.pwd = pwd;
		this.usex = usex;
		this.tel = tel;
		this.birthday = birthday;
		this.uprofile = uprofile;
		this.introduce = introduce;
		this.ulevel = "1";
		this.ustatus = 1;
		this.regdate = sdf.format(new Date());
	}

	/**
	 * 用户必填字段构造方法
	 * 
	 * @param uname
	 * @param pwd
	 */
	public User(String uname, String pwd) {
		super();
		this.uname = uname;
		this.pwd = pwd;
		this.ulevel = "1";
		this.ustatus = 1;
		this.regdate = sdf.format(new Date());
	}

	/**
	 * get & set方法
	 * 
	 * @param @return
	 * @return @return
	 */
	public int getUid() {
		return uid;
	}

	public void setUid(int uid) {
		this.uid = uid;
	}

	public String getUname() {
		return uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String getUsex() {
		return usex;
	}

	public void setUsex(String usex) {
		this.usex = usex;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public String getUprofile() {
		return uprofile;
	}

	public void setUprofile(String uprofile) {
		this.uprofile = uprofile;
	}

	public String getIntroduce() {
		return introduce;
	}

	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}

	public String getUlevel() {
		return ulevel;
	}

	public void setUlevel(String ulevel) {
		this.ulevel = ulevel;
	}

	public int getUstatus() {
		return ustatus;
	}

	public void setUstatus(int ustatus) {
		this.ustatus = ustatus;
	}

	public String getRegdate() {
		return regdate;
	}

	public void setRegdate(String regdate) {
		this.regdate = regdate;
	}
	
}
